home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
8bitfiles.net/archives
/
archives.tar
/
archives
/
commodore-users-of-norman
/
CUON_25_(10-1984).d64
/
robot math_vic
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2019-04-13
|
3KB
|
102 lines
1 READP1$,P2,P3$,P4:GOTO62
2 POKEB,0:POKEB+1,0:POKEB+2,0:POKEB+4,0:RETURN
3 POKEB+4,15:POKEB+1,180:FORM=1TOC:NEXT:GOTO2
4 F=INT(RND(1)*9):RETURN
5 POKED,3:POKED+1,3:POKEB+4,15:FORL=99TO255:POKEB+2,L:POKEB,L:NEXT:GOSUB2:GOTO92
6 POKEB+4,15:POKEB+2,160:FORM=1TO400:NEXT:GOTO2
7 PRINTM$;" PRESS RTN TO CHANGE":RETURN
8 PRINTM$;" ENTER DIGIT[146] ":RETURN
9 IFF>5THENL=126:IFF>9THENL=108:M=1:IFF>30THENL=90:M=0:IFF>50THENL=108:M=1:IFF>99THENF=0
10 POKEE,L:POKEE+1,L:POKED+21,M:POKED+24,M:GOTO36
11 PRINT"":PRINTTAB(L);M$;O$;:GOSUB3:PRINTN$:RETURN
12 M$=" [206][163][163][205] [157][157][157][157][157][157] [205][218][218][206] [157][157][157][157][157][157] [187][204][186][172] [157][157][157][157][157][157] [169][171][179][223] [157][157][157][157][157][157] [207][208] [157][157][157][157][157][157] [169] [223][146] "
13 N$="[157][157][157][157][157][157] [215][215][215][215] ":O$="[157][157][157][157][157][157] [218][218][218][218] ":B=36874:READP1$,P2,P3$,P4:POKEB+5,30:POKE649,1
14 PRINT"[147] M=MENU-----DEL=ERASE ":L8=48:POKE143,PEEK(162):GOTO92
15 POKE651,255:PRINT"":R=38649:S=7929:Y=P2:D=38446:E=7726:IFP1$="-"ORP2=1ORP2>3THENY=2
16 FORI=P2TO1STEP-1:A(I)=0:S(I)=0:FORK=1TOY:GOSUB3:GOSUB4
17 A(I)=A(I)+F:S(I)=S(I)-F
18 M=(K*22)+I:POKER+M,4:POKES+M,F+48:IFK=1THENL1=F
19 NEXT:IFP1$="-"THENGOSUB57:GOTO21
20 L=A(I):N=9:GOTO22
21 S(I)=S(I)+2*L1:L=S(I):N=0
22 GOSUB49:A(I)=L
23 NEXTI
24 FORK=1TOY:FORI=1TOP2
25 M=K*22+I:IFPEEK(S+M)>48THEN28
26 IFI=P2THENV=1
27 POKES+M,32:NEXT
28 NEXTK:IFV=1THENV=0:GOTO15
29 A=0:U=-1:FORI=P2TO1STEP-1:U=U+1:IFP1$="-"THENA=A+S(I)*10^U:GOTO31
30 A=A+A(I)*10^U
31 NEXT
32 A=INT(A):L2=0:IFA<0THEN15
33 PRINT"":FORI=2TOY:PRINTTAB(7);P1$:NEXT:POKE160,0:POKE161,0:POKE162,0
34 PRINT"[145][145][145][145]":FORK=0TOP2:PRINTTAB(7+K);"[195][157] [145][145][145][145][145]":NEXT
35 PRINT"":U=LEN(STR$(A))-2:I=0:L1=0:FORK=P2TOP2-USTEP-1
36 FORM=6TO8:POKEM+E+154,ASC(MID$(TI$,M-2))+128:NEXT:IFTI$="000400"THENGOSUB6:GOTO46
37 GETA$:IFA$=""THENL=124:F=F+1:GOTO9
38 IFASC(A$)=20THENPRINTTAB(7);" ";"[145][145][145][145][145]":GOTO35
39 IFA$="M"THENPOKEB+5,27:GOTO62
40 IFA$<"0"ORA$>"9"THEN37
41 L1=INT(L1+VAL(A$)*10^I):I=I+1:PRINTTAB(7+K);A$:PRINT"[145][145]":NEXT
42 IFL1=ATHENGOSUB5
43 IFL1<>ATHENGOSUB6
44 L2=L2+1:IFL2>2THEN46
45 PRINT"[145][145]":GOTO34
46 V=0:AN$=STR$(A):L=LEN(AN$):IFL>P2+1THENV=1
47 IFL-1<P2THENV=L-1-P2
48 PRINTTAB(8-V);"";MID$(AN$,2,8):FORK=1TO3500:NEXT:GOTO15
49 IFP3$="N"ANDP1$="+"THEN52
50 GOSUB4:X=1:IFL<N+FTHEN54
51 RETURN
52 IFL>NTHENX=-1:GOTO54
53 RETURN
54 L=0:FORK=1TOY:M=(K*22)+I:F=PEEK(S+M)+X:IFF<48THENF=48
55 IFF>57THENF=57
56 POKES+M,F:L=L+(F-48):NEXT:GOTO49
57 IFP3$="N"THEN60
58 IFI=1ORF>=L1THENRETURN
59 GOTO61
60 IFF<L1THENRETURN
61 POKES+M,L1+48:POKES+M-22,F+48:S(I)=(-F)-L1:L1=F:RETURN
62 M$="":PRINT"[147]OPERATION (+/-).... ";P1$
63 PRINT"# DIGITS (MAX=6)...";P2:PRINT"CARRY/BORROW....... ";P3$
64 PRINT"# PROBLEMS (MAX=9).";P4:PRINT" [197][197][197][197][197][197][197][197][197][197][197][197][197][197]
65 [141]7:[153]" OPEN(B TO BEGIN)";"SELECT:USE CRSR(UP/DN)STOP
66 M=7746
67 IFM1=7878THENM=7746
68 FORI=MTOM+20:POKEI,PEEK(I)+128:NEXT
69 GETA$:IFA$=""THEN69:A=A+128:POKEI,A:NEXT
70 IFVAL(A$)<10ANDVAL(A$)>0THEN82
71 IFA$="+"ORA$="-"ORA$="Y"ORA$="N"ORPEEK(197)=15THENA$="1":GOTO82
72 IFA$=""THEN77
73 IFA$="[145]"THEN81
74 IFA$<>"B"THEN69
75 PRINT"[147]91 DATA";P1$;",";P2;",";P3$;",";P4:PRINT"RUN12";"
76 :[151]198,3:[151]631,13:[151]632,13:[151]633,13:[128]
77 M2[178]M2[171]1:K[178]44
78 M[178]M[170]K:[129]I[178]M[171]K[164]M[171]K[170]20:[151]I,[194](I)[171]128:[130]:[139]M[177]7878[167]M[178]7746
79 [139]M[179]7746[167]M[178]7878
80 [145](M[171]7702)[173]44[141]7,8,7,8:[137]67
81 M2[178]M2[171]1:K[178][171]44:[137]78
82 [145](M[171]7746)[173]44[137]85,87,90:[139]P1$[178]"+"[167]P1$[178]"-":[137]84
83 P1$[178]"+"
84 [151]M[170]20,[198](P1$)[170]128:[137]69
85 [139][197](A$)[177]6[167]A$[178]"6"
86 P2[178][197](A$):[151]M[170]20,P2[170]176:[137]69
87 [139]P3$[178]"N"[167]P3$[178]"Y":[137]89
88 P3$[178]"N"
89 [151]M[170]20,64[170][198](P3$):[137]69
90 P4[178][197](A$):[151]M[170]20,P4[170]176:[137]69
91 [131]+, 1 ,Y, 2
92 C[178]0:[153]"STOP":[129]L[178]0[164]15:[141]11:[130]
93 [129]L[178]14[164]0[169][171]1:[141]11:[130]:[153]"STOP":C[178]40
94 L8[178]L8[170]1:M[178]34816[170]8[172]L8:[153]"":[139]L8[171]48[177]P4[167]98
95 [129]M1[178]M[164]M[170]6:X[178][194](M1):[129]L[178]1[164]7:C[178]32:X[178]X[172]2:[139]X[177]255[167]X[178]X[171]256:C[178]L8
96 [153][163]13)"OPEN";[199](C);:[130]:[153]"STOP":[130]:[139]L8[171]48[177]P4[167]98
97 [137]15
98 [151]B[170]5,27:[153]"LOAD";[166]176);"PLAY ANOTHER GAME(Y/N)WAIT"
99 [161]Z$:[139]Z$[178]""[176](Z$[179][177]"Y"[175]Z$[179][177]"N")[167]99
100 [139]Z$[178]"N"[167][128]
101 [138]1